package com.atos.optical.model.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wanghra
 * @version 1.0
 * @description 用户信息表
 * @date 2025/8/11
 */
@Data
@Entity
@Table
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SysUserInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     */
    @Id
    @Column(name = "USER_ID", length = 50, nullable = false)
    @TableId(value = "USER_ID", type = IdType.ASSIGN_UUID)
    private String userId;
    /**
     * 用户名
     */
    @Column(name = "USER_NAME", length = 200, nullable = false)
    @TableField(value = "USER_NAME")
    private String userName;
    /**
     * 登录名（账号）
     */
    @Column(name = "LOGIN_NAME", length = 50, nullable = false)
    @TableField(value = "LOGIN_NAME")
    private String loginName;
    /**
     * 用户密码
     */
    @Column(name = "USER_PWD", length = 50, nullable = false)
    @TableField(value = "USER_PWD")
    private String userPwd;
    /**
     * 用户状态：0 -> 禁用；1 -> 启用；
     */
    @Column(name = "USER_STATUS", length = 1, nullable = false)
    @TableField(value = "USER_STATUS")
    private String userStatus;
    /**
     * 逻辑删除标识：0 -> 未删除；1 -> 已删除；
     */
    @TableLogic
    @Column(name = "IS_DELETED", length = 1, nullable = false)
    @TableField(value = "IS_DELETED", fill = FieldFill.INSERT)
    private String isDeleted;
    /**
     * 用户手机号
     */
    @Column(name = "USER_MOB_TEL", length = 11)
    @TableField(value = "USER_MOB_TEL")
    private String userMobTel;
    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "CREATE_TIME")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT, insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime createTime;
    /**
     * 修改日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "MODIFY_TIME")
    @TableField(value = "MODIFY_TIME", fill = FieldFill.UPDATE)
    private LocalDateTime modifyTime;
    /**
     * 最后一次登录日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "LOGIN_TIME")
    @TableField(value = "LOGIN_TIME")
    private LocalDateTime loginTime;
}
